/* eslint-disable @typescript-eslint/no-var-requires */
const App = require('../dist').default;
const Path = require('path');

const page = `
<html>
<head><meta charset="utf-8"></head>
<body>
<h1>Test File Downoad!</h1>
<a href="/download">Click to Download</a>
</body>
</html>`;

App.start({
	controllers: {
		'/': async (ctx) => await ctx.sendHtml(page),
		'/download': async (ctx) => {
			await ctx.sendFile(Path.resolve(__dirname, '../package-lock.json'), { inline: true, gzip: true });
		},
	},
});
